< previous page page_838 next page >

Page 838
the same directory as the test project. Open the file using Notepad and review its contents. You see the login record, the start of the form, the end of the form, and the log out record. The results of a similar run are included in the following lines:
************************************************************
prjTest Audit Log
Created: 19-Feb-97 12:39:19 AM
************************************************************

"19-Feb-97 6:04:59 AM","default","UserLogin","Main"
"19-Feb-97 6:04:59 AM","default","UserMaint","Main","StartForm"
"19-Feb-97 6:06:22 AM","default","UserMaint","Main","ExitForm"
"19-Feb-97 6:06:27 AM","default","UserLogOut","Main"
Once you confirm that your objects are working properly, compile the ActiveX DLL and close the project. You're now ready to create a short data entry application that uses all the features of your new security library.
Adding Security to a Data Entry Form
In this final example, you build a quick data entry form using data-bound controls, and add user login, access rights, and audit logging to the form. This shows how you can provide tight security even in simple data-bound forms.
warning.gif
You need to run the SecTest.SQV script using the SQLVB5 interpreter to create the proper tables and entries in the BOOKS5.MDB that is used by this exercise. You can find this SQV script in the Chap21 folder on the CD. See Appendix A for more information on running SQLVB5.

First, start a new Visual Basic 5 Standard EXE project and select Project | References . . . to load the new Security library (prjUsrObject.dll) to your project (see Figure 21.11).
Refer to Table 21.6 and Figure 21.12 to lay out the new data entry form.
warning.gif
The command buttons on this form are in a control array. You must pay close attention to how they are arranged on the form in order for the security features to work properly.

 
< previous page page_838 next page >

If you like this book, buy it!